import {Request} from "../../utils/request";
import host from "../../utils/host";
const HostUrl = host.service;
const Requ = new Request();
var app = getApp();
Page({
  data: {

  },
  onLoad: function(options) {
    wx.showLoading({
      title: '加载中'
    })
    wx.login({
      success: function(res) {
		  console.log(res)
        if (res.code) {
          new Request('user_login.cls.php').request(
            () => {
              return {
                code: res.code,
                wx:1
              }
            },
            (res) => {
				console.log(res)
              wx.hideLoading();
              app.globalData.openid = res.data.openid;
              wx.switchTab({
                url: '/pages/home/home',
              })
			  /* wx.navigateTo({
				  url:"/pages/order_details/order_details"
			  }) */
          });
        }
      }
    })
  },
})